/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package book.test;

import java.io.BufferedReader;
import java.io.InputStreamReader;

/**
 *
 * @author Administrator
 */
public class TrycatchDemov1 {
    public static void main(String[] args) {
        int result = 0;
        try{
            BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
            System.out.println("请输入第一个数");
            int num1 = Integer.parseInt(br.readLine());
            System.out.println("请输入第二个数");
            int num2 = Integer.parseInt(br.readLine());
            result = calculate(num1,num2);
            System.out.println("结果是"+result);
            
        }
        catch(Exception e){
            System.out.println("发生异常："+e.toString());
        }
    }
    static int calculate(int a,int b){
        int c=a/b;return c;
    }

}
